<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改岗位管理')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-post-edit" th:object="${wstPost}">
        <input name="postId" th:field="*{postId}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">岗位编码：</label>
            <div class="col-sm-8">
                <input name="postCode" th:field="*{postCode}" class="form-control" type="text" disabled>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">岗位名称：</label>
            <div class="col-sm-8">
                <input name="postName" th:field="*{postName}" class="form-control" type="text" disabled>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">招聘人数：</label>
            <div class="col-sm-8">
                <input name="needNum" th:field="*{needNum}" class="form-control" type="text" disabled>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">工资：</label>
            <div class="col-sm-8">
                <input name="salary" th:field="*{salary}" class="form-control" type="text" disabled>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">工作介绍：</label>
            <div class="col-sm-8">
                <textarea readonly name="mainwork" th:field="*{mainwork}" class="form-control" type="text" rows="5"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">工作地址：</label>
            <div class="col-sm-8">
                <input name="workplace" readonly th:field="*{workplace}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">招聘开始时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input readonly name="startTime" th:value="${#dates.format(wstPost.startTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">招聘结束时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input readonly name="endTime" th:value="${#dates.format(wstPost.endTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">联系电话：</label>
            <div class="col-sm-8">
                <input readonly name="phone" th:field="*{phone}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea readonly name="remark" class="form-control">[[*{remark}]]</textarea>
            </div>
        </div>
    </form>
</div>
<div class="row">
    <div class="col-sm-offset-5 col-sm-10">
        <button type="button" class="btn btn-sm btn-primary" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭</button>&nbsp;
    </div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:inline="javascript">
    var prefix = ctx + "wstudy/post";
    $("#form-post-edit").validate({
        focusCleanup: true
    });

    $("input[name='startTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='endTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $(".file-upload").each(function (i) {
        var val = $("input[name='" + this.id + "']").val()
        $(this).fileinput({
            'uploadUrl': ctx + 'common/upload',
            initialPreviewAsData: true,
            initialPreview: [val],
            maxFileCount: 1,
            autoReplace: true
        }).on('fileuploaded', function (event, data, previewId, index) {
            $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
        }).on('fileremoved', function (event, id, index) {
            $("input[name='" + event.currentTarget.id + "']").val('')
        })
        $(this).fileinput('_initFileActions');
    });
</script>
</body>
</html>